package com.ala4.oxcafe.entity;

import com.ala4.oxcafe.core.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 角色菜单关联表
 *
 * @author PING
 * @version 1.0.0
 * @date 2025/8/12 17:57
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("role_menu_rel")
@Schema(description = "角色菜单关联表")
public class RoleMenuRel extends BaseEntity {

    @Schema(description = "主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @NotNull(message = "ID不能为空", groups = {RoleInfo.Update.class})
    private Long id;

    @Schema(description = "角色ID")
    private Long roleId;

    @Schema(description = "菜单ID")
    private Long menuId;

    @Schema(description = "菜单路径")
    private String menuPath;

    public RoleMenuRel() {
    }

    public RoleMenuRel(Long roleId, Long menuId) {
        this.roleId = roleId;
        this.menuId = menuId;
    }

    public RoleMenuRel(Long roleId, String menuPath) {
        this.roleId = roleId;
        this.menuPath = menuPath;
    }
}
